package com.ewanghuiju.app.ui.main.activity;

import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.ewanghuiju.app.R;
import com.ewanghuiju.app.base.BaseActivity;
import com.ewanghuiju.app.base.contract.main.HistoryRecordContract;
import com.ewanghuiju.app.model.bean.response.HistoryRecordResponBean;
import com.ewanghuiju.app.presenter.main.HistoryRecordPresenter;
import com.ewanghuiju.app.test.bean.TestBean;
import com.ewanghuiju.app.ui.main.adapter.HistoryRecordAdapter;
import com.gyf.immersionbar.ImmersionBar;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;

import java.util.List;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;

/**
 * @author sj  qq:751943509
 * @class 历史记录页面
 * @time 2020/2/14
 */
public class HistoryRecordActivity extends BaseActivity<HistoryRecordPresenter> implements HistoryRecordContract.View {

    @BindView(R.id.toolbar)
    RelativeLayout toolbar;
    @BindView(R.id.iv_clear)
    ImageView ivClear;
    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;
    @BindView(R.id.refreshLayout)
    SmartRefreshLayout refreshLayout;

    private List<HistoryRecordResponBean> list;

    @Override
    protected void initInject() {
        getActivityComponent().inject(this);
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_history_record;
    }

    @Override
    protected void initEventAndData() {
        initHistorList();

    }

    private void initHistorList() {
        list = TestBean.getHistoryRecordResponBeanList(10);
        recyclerView.setNestedScrollingEnabled(false);
        HistoryRecordAdapter adapter = new HistoryRecordAdapter(list);
        recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
        recyclerView.setAdapter(adapter);
//        adapter.notifyDataSetChanged();
    }


    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        ImmersionBar.with(this)
                .titleBar(toolbar, true)
//                .transparentBar()
                .statusBarDarkFont(true)
                .init();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    @Override
    public void showContent(String list) {

    }

    @Override
    public void showMoreContent(String list) {

    }
}
